<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta http-equiv="Cache-Control" content="No-Cache">
	<meta http-equiv="Pragma" content="No-Cache">

	<title>문자열테스트</title>
</head>

<body>
<?php

	$param_values = 'yyyy=2012&user_id=&user_name=김미선&sex=여&solunar=solar&my_solnuar=solar&request_year=1982&request_month=04&request_day=05&request_hour=10&youn=0&setDate=2012-06-26&your_month=06&your_hour=0&your_year=1982&your_solunar=solar&your_user_name=한영수&your_day=04&your_youn=0&your_min=00&request_min=00&cate=saju&sel=1&solution_var=DB&url=&what=&name1=&page=&';
	$split = explode('&', $param_values);
	$map = array();
	
	foreach ($split as $item) {
		$tmp_split = preg_split('/=/', $item);
		if (isset($tmp_split[1])) {
			$map[$tmp_split[0]] = $tmp_split[1];
		}
	}
	
	echo "<pre>";
	echo "split=".print_r($split, TRUE);
	echo "</pre>";
	echo "<br>";
	echo "<pre>";
	echo "map=".print_r($map, TRUE);
	echo "</pre>";
	echo "<br>";

	function get_star_job_icon($star_job) {
		$arr_star_job = explode(',', $star_job);
				
		$job_list['actor']      = array('영화배우', '영화감독', '영화인', '영화제작자', '영화촬영감독');
		$job_list['gag']        = array('개그맨', '코미디언');
		$job_list['golf']       = array('운동선수', '스케이트선수', '농구선수', '야구선수', '카레이서', '축구선수', '골프선수');
		$job_list['mc']         = array('MC', 'VJ', '방송인', '아나운서');
		$job_list['misskorea']  = array('미스코리아', '모델');
		$job_list['musical']    = array('뮤지컬배우', '연극배우');
		$job_list['politician'] = array('국회의원', '공무원', '금융인', '기업인', '대학교수', '교수', '문화기관단체인', '연세대 교회음악과 교수', '정당인');
		$job_list['singer']     = array('가수', '바이올리니스트', '대중음악작곡가', '성악가', 'DJ', '국립합창단 예술감독', '음악PD', '오페라가수', '음악감독', '작곡가', '작사가', '지휘자', '첼리스트');
		$job_list['talent']     = array('탤런트', '방송연예인', '연예인');
		$job_list['and']        = array('그밖에', '방송작가', '사진작가', 'PD', '만화가', '공연기획자', '연예기획자', '작가', '촬영감독');
		
		foreach ($arr_star_job as $value) {
			$value = trim($value);
			
			foreach ($job_list as $key => $item) {
				if (in_array($value, $item)) {
					return $key;
				}
			}
		}
		
		return 'and';
	}
	
	echo get_star_job_icon('영화배우,가수');
?>
</body>
</html>